//
//  MineViewController.m
//  XIWenLeJian
//
//  Created by lanou3g on 15/11/11.
//  Copyright © 2015年 蓝足. All rights reserved.
//

#import "MineViewController.h"
#import "MineTableViewCell.h"
#import "LoginViewController.h"

@interface MineViewController ()


@end

@implementation MineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.tableView registerClass:[MineTableViewCell class] forCellReuseIdentifier:@"cell"];
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 6;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MineTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    if (indexPath.row == 0) {
        cell.label.text = @"我的账户";
        cell.mineImageView.image = [UIImage imageNamed:@"iconfont-taogongzi"];
    }else if (indexPath.row == 1){
        cell.label.text = @"管理我的收藏";
        cell.mineImageView.image = [UIImage imageNamed:@"iconfont-guanlizhongxin"];
    }else if (indexPath.row == 2){
        cell.label.text = @"清除缓存";
        cell.mineImageView.image = [UIImage imageNamed:@"iconfont-huodongguanli"];
    }else if (indexPath.row == 3){
        cell.label.text = @"夜间模式";
        cell.mineImageView.image = [UIImage imageNamed:@"iconfont-yejianmoshi"];
    }else if (indexPath.row == 4){
        cell.label.text = @"关于我";
        cell.mineImageView.image = [UIImage imageNamed:@"iconfont-guanyu"];
    }else{
        cell.label.text = @"设置";
        cell.mineImageView.image = [UIImage imageNamed:@"iconfont-shezhi"];
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        LoginViewController *loginVC = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:loginVC animated:YES];
    }
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
